package bairui.international.model.domain.jpa;

/**
 *
 * @see TB_SystemConfig 系统设置
 *
 */
public class TestData_TB_SystemConfig
{

	private final static org.apache.commons.text.RandomStringGenerator Generator = new org.apache.commons.text.RandomStringGenerator.Builder().withinRange(new char[][]{{'a','z'}, {'A','Z'}, {'0','9'}}).build();

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_SystemConfig saveMust(
		org.springframework.context.ApplicationContext context
		
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_SystemConfig");
		return (TB_SystemConfig)repository.save(newMust(
				
			));
	}
	
	public static TB_SystemConfig newMust(
		
	){
		return new TB_SystemConfig(new TB_SystemConfig.MustProperties() {
			/** 一级分成比例 */
			@Override public Double getFirstLevelDivideRatio(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
			}
			/** 一级再分成比例 */
			@Override public Double getFirstLevelSubDivideRatio(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
			}
			/** 二级分成比例 */
			@Override public Double getSecondLevelDivideRatio(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
			}
			/** 二级再分成比例 */
			@Override public Double getSecondLevelSubDivideRatio(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
			}
			/** 普通用户发起首次充值最小额度 */
			@Override public Double getGeneralUserFirstRechargeMinAmount(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 充值最小额度 */
			@Override public Double getRechargeMinAmount(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
			/** 提现最小额度 */
			@Override public Double getWithdrawMinAmount(){
				return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
			}
		});
	}
	

	@SuppressWarnings({ "unchecked", "rawtypes" })
	@org.springframework.transaction.annotation.Transactional(rollbackFor=java.lang.Throwable.class)
	public static TB_SystemConfig saveAll(
		org.springframework.context.ApplicationContext context
		
	){
		org.springframework.data.jpa.repository.JpaRepository repository = (org.springframework.data.jpa.repository.JpaRepository)context.getBean("repository_SystemConfig");
		return (TB_SystemConfig)repository.save(newAll(
				
			));
	}
	
	public static TB_SystemConfig newAll(
		
	){
		return new TB_SystemConfig(
			new TB_SystemConfig.MustProperties() {
				/** 一级分成比例 */
				@Override public Double getFirstLevelDivideRatio(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
				}
				/** 一级再分成比例 */
				@Override public Double getFirstLevelSubDivideRatio(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
				}
				/** 二级分成比例 */
				@Override public Double getSecondLevelDivideRatio(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
				}
				/** 二级再分成比例 */
				@Override public Double getSecondLevelSubDivideRatio(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, 100);
				}
				/** 普通用户发起首次充值最小额度 */
				@Override public Double getGeneralUserFirstRechargeMinAmount(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 充值最小额度 */
				@Override public Double getRechargeMinAmount(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
				/** 提现最小额度 */
				@Override public Double getWithdrawMinAmount(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.doubleRandom(0, Long.MAX_VALUE);
				}
			},
			new TB_SystemConfig.OptionalSingleProperties() {
				/** 一级分成比例说明 */
				@Override public String getFirstLevelDivideRatioComment(){
					return Generator.generate(0, 500);
				}
				/** 一级再分成比例说明 */
				@Override public String getFirstLevelSubDivideRatioComment(){
					return Generator.generate(0, 500);
				}
				/** 二级分成比例说明 */
				@Override public String getSecondLevelDivideRatioComment(){
					return Generator.generate(0, 500);
				}
				/** 二级再分成比例说明 */
				@Override public String getSecondLevelSubDivideRatioComment(){
					return Generator.generate(0, 500);
				}
				/** 普通用户发起首次充值最小额度说明 */
				@Override public String getGeneralUserFirstRechargeMinAmountComment(){
					return Generator.generate(0, 500);
				}
				/** 充值最小额度说明 */
				@Override public String getRechargeMinAmountComment(){
					return Generator.generate(0, 500);
				}
				/** 提现最小额度说明 */
				@Override public String getWithdrawMinAmountComment(){
					return Generator.generate(0, 500);
				}
				/** 订单过期时间[分] */
				@Override public Long getOrderExpireTime(){
					return com.sh_lianjing.test.random.Util_GenerateRandom.longRandom(0, Long.MAX_VALUE);
				}
			}
		);
	}
	

}
